From: Jo-Philipp Wich Date: Fri, 9 Apr 2021 12:24:46 +0000 (+0200) Subject: luci-compat: update markup for CBI TableSections X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=7bb2fc4913e16fc515209343fdf6e2e68f9d1809;p=project%2Fluci.git luci-compat: update markup for CBI TableSections Update legacy CBI markup to use actual table, tr, th and td elements instead of using div element corresponding table classes. Fixes compatibility with OpenWrt 2020 theme. Ref: https://github.com/openwrt/luci/issues/4972 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 2155868175fdf1de273cafc0b37b1b9fd5900b04) --- diff --git a/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm b/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm index bdd6bc9687..786ee43d10 100644 --- a/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm +++ b/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm @@ -1,2 +1,2 @@ - + diff --git a/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm b/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm index db5c66850d..31d1acee48 100644 --- a/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm +++ b/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm @@ -3,7 +3,7 @@ local descr = luci.util.trim(striptags(self.description)) local ftype = self.typename or (self.template and self.template:gsub("^.+/", "")) -%> -
0, "data-widget", ftype) .. ifattr(title and #title > 0, "data-title", title, true) .. diff --git a/modules/luci-compat/luasrc/view/cbi/tblsection.htm b/modules/luci-compat/luasrc/view/cbi/tblsection.htm index c60915a6a6..048eb22c41 100644 --- a/modules/luci-compat/luasrc/view/cbi/tblsection.htm +++ b/modules/luci-compat/luasrc/view/cbi/tblsection.htm @@ -46,12 +46,12 @@ function render_titles() return end - %>
><% + %>><% local i, k for i, k in ipairs(self.children) do if not k.optional then - %>
><% if k.titleref then @@ -64,15 +64,15 @@ function render_titles() %><% end - %>
<% + %><% end end if self.sortable or self.extedit or self.addremove then - %>
<% + %><% end - %>
<% + %><% rowcnt = rowcnt + 1 end @@ -82,25 +82,25 @@ function render_descriptions() return end - %>
<% + %><% local i, k for i, k in ipairs(self.children) do if not k.optional then - %>
><% write(k.description) - %>
<% + %><% end end if self.sortable or self.extedit or self.addremove then - %>
<% + %><% end - %>
<% + %><% rowcnt = rowcnt + 1 end @@ -116,7 +116,7 @@ end <%- end -%>
<%=self.description%>
-
+ <%- render_titles() render_descriptions() @@ -134,7 +134,7 @@ end valuefooter = "cbi/cell_valuefooter" } -%> -
> +
> <%- local node for k, node in ipairs(self.children) do @@ -145,7 +145,7 @@ end -%> <%- if self.sortable or self.extedit or self.addremove then -%> -
+
<%- end -%> - + <%- end -%> <%- if isempty then -%> -
-
<%:This section contains no values yet%>
-
+ + + <%- end -%> - +
<%- if self.sortable then -%> @@ -162,17 +162,17 @@ end <%- end -%>
- +
<%:This section contains no values yet%>
<% if self.error then %>